package com.medicine.hbp.base;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.widget.BaseAdapter;

@SuppressWarnings("rawtypes")
public abstract class MyBaseAdapter extends BaseAdapter {
	protected List items = new ArrayList();
	protected Activity activity;

	@Override
	public int getCount() {
		return items.size();
	}

	@Override
	public Object getItem(int position) {
		return items.get(position);
	}


	public void setItems(List items) {
		this.items = items;
	}

	public void addItems(List items) {
		this.items.addAll(items);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	public List getItems() {
		return items;
	}

	public void changeData(List items) {
		if (items != null) {
			this.items = items;
			this.notifyDataSetChanged();
		}
	}
}
